package net.jkdmanager.server.webservices;

import java.util.List;

import javax.jws.WebService;

import net.jkdmanager.common.api.model.Application;
import net.jkdmanager.common.api.model.plugins.PluginsDescriptor;
import net.jkdmanager.common.services.plugins.PluginRegistryService;
import net.jkdmanager.server.model.AgentStatus;
import net.jkdmanager.server.services.agents.AgentStatusesService;
import net.jkdmanager.server.services.model.ModelService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("modelWebService")
@WebService(serviceName="modelWebService")
public class WebServiceImpl {

	@Autowired
	private ModelService modelService;
	
	@Autowired
	private PluginRegistryService pluginRegistryService;
	
	@Autowired
	private AgentStatusesService agentStatusesService;
	
	public Long createApplication(Application application) {
		return modelService.createApplication(application);
	}
	
	public PluginsDescriptor getPluginsDescriptor() {
		return pluginRegistryService.getPluginsDescriptor();
	}
	
	public List<Application> getAllApplications() {
		return modelService.getAllApplications();
	}
	
	public List<AgentStatus> getAgentStatuses() {
		return agentStatusesService.getAgentStatuses();
	}
		
}
